jQuery().ready(
			function(){
jQuery("#list1").jqGrid({
							url : '../data/servers_detail.xml',
							datatype : "xml",
							colNames : [ '服务器名称', 'IP', '类型','SNMP配置','运行时间','服务器状态', 'CPU使用率', 'CPU负载','内存使用率','磁盘I/O','网络流量','磁盘空间使用率','系统进程数', ],
							colModel : [ {
								name : 'id',
								index : 'id',
								width : 75
							}, {
								name : 'invdate',
								index : 'invdate',
								width : 150,
								editable:false,
							}, {
								name : 'name',
								index : 'name',
								width : 100,
								editable:false,
							}, {
								name : 'name',
								index : 'name',
								width : 100,
								editable:false,
							}, {
								name : 'amount',
								index : 'amount',
								width : 80,
								align : "right",
								editable:false,
							}, {
								name : 'note',
								index : 'note',
								width : 150,
								sortable : false
							} , {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}, {
								name : 'status',
								index : 'note',
								width : 150,
								sortable : false,
								align:'center',
							}],
							rowNum : 10,
							autowidth : true,
							rowList : [ 10, 20, 30 ],
							pager : jQuery('#pager1'),
							sortname : 'id',
							viewrecords : false,
							sortorder : "desc",
							multiselect: false,
							cellEdit: false,
							caption : "服务器监控综合列表",
							cellsubmit: 'clientArray'
						})
						
						jQuery("#list1").navGrid('#pager1',{edit:false,add:false,del:false,search:false}).navButtonAdd('#pager1'
							,{  
								caption:"", buttonicon:"ui-icon-search",   
								onClickButton: function(){searchevent();}, position:"last"  
						    }
							
						);		
			});



var alarmToday = {};
alarmToday.constructBarChartData = function() {
	var d1 = [];
	var d2 = [];                                 // First data series
    var d3 = [];
    var d4 = [];
	var point1;
	var point2;
	var point3;
	var point4;
	var i;
//	for ( i = 0; i < 4; i++) {
		point1 = [1, 100];
		point2 = [2, 30];
		point3 = [3, 50];
		point4 = [4, 50];
		d1.push(point1);
		d2.push(point2);
		d3.push(point3);
		d4.push(point4);

//	}
	return [d1, d2, d3, d4];
};
alarmToday.barChartData = alarmToday.constructBarChartData();

alarmToday.barChartOptions = {
	bars : {
		show : true,
		horizontal : false,
		shadowSize : 0,
		barWidth : 0.5
	},
	mouse : {
		track : true,
		relative : true
	},
	xaxis: {
         ticks:[[1,"业务系统"],[2,"网络协议"],[3,"服务器"],[4,"服务"]], // 自定义X轴
               minorTicks: null,
               showLabels:true,                             // 是否显示X轴刻度
               showMinorLabels:false,
               labelsAngle:15,                              //x轴文字倾斜角度
               title:'今日告警项目统计图',                                 //x轴标题
               titleAngle:0,                                //x轴标题倾斜角度
               noTicks:12,                                   //当使用自动增长时,x轴刻度的个数
               minorTickFreq:null,                           //
               tickFormatter: Flotr.defaultTickFormatter,   //刻度的格式化方式
               tickDecimals:0,                              //刻度小数点后的位数
               min:null,                                    //刻度最小值  X轴起点的值
               max:null,                                    //刻度最大值
               autoscale:true,
               autoscaleMargin:0,
               color:null,                             //x轴刻度的颜色
               mode:'normal',
               timeFormat:null,                            
               timeMode:'UTC',                               //For UTC time ('local' for local time).
               timeUnit:'year',                             //时间单位 (millisecond, second, minute, hour, day, month, year) 
               scaling:'linear',                            //linear or logarithmic
               base:Math.E,
               titleAlign:'center',                         //标题对齐方式
               margin:true
        },
	yaxis : {
		//ticks: [ [-10,"-10"], [0,"0"], [10,"10"], [20,"20"], [30,"30"],[40,"40"] ],  
                minorTicks: null,      // => format: either [1, 3] or [[1, 'a'], 3]
                showLabels: true,      // => setting to true will show the axis ticks labels, hide otherwise
                showMinorLabels: false,// => true to show the axis minor ticks labels, false to hide
                labelsAngle: 0,        // => labels' angle, in degrees
                title: '告警数',           // => axis title
                titleAngle: 90,        // => axis title's angle, in degrees
                noTicks: 5,            // => number of ticks for automagically generated ticks
                minorTickFreq: null,   // => number of minor ticks between major ticks for autogenerated ticks
                tickFormatter: Flotr.defaultTickFormatter, // => fn: number, Object -> string
                tickDecimals: 'no',    // => no. of decimals, null means auto
                min: 0,             // => min. value to show, null means set automatically
                max: null,             // => max. value to show, null means set automatically
                autoscale: false,      // => Turns autoscaling on with true
                autoscaleMargin: 0,    // => margin in % to add if auto-setting min/max
                color: null,           // => The color of the ticks
                scaling: 'linear',     // => Scaling, can be 'linear' or 'logarithmic'
                base: Math.E,
                titleAlign: 'center',
                margin: true           // => Turn off margins with false
	}
};

alarmToday.pieChartData = [{
	data : [[0, 15]],
	label : "正常"
}, {
	data : [[0, 3]],
	label : "提醒"
}, {
	data : [[0, 5]],
	label : "故障",
		pie : {
		explode : 20
	}
}];

alarmToday.pieChartOptions = {
	HtmlText : false,
	grid : {
		verticalLines : false,
		horizontalLines : false
	},
	xaxis : {
		showLabels : false
	},
	yaxis : {
		showLabels : false
	},
	pie : {
		show : true,
		explode : 6
	},
	mouse : {
		track : true
	},
	legend : {
		position : "se",
		backgroundColor : "#D2E8FF"
	}
};

